<ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:c="http://java.sun.com/jsp/jstl/core">
    <!-- FIXME: find why is needed the style='height:20px'-->
    <div class="ds-grid-footer ui-widget-header ui-helper-clearfix #{ajustStyle}" style="height:15px;" title="ajaxMode=#{ajaxMode}">
        <div class="ds-grid-paging ui-helper-clearfix">
            <h:panelGroup
                rendered="#{! pageHelper.pageInfo.hasPrevious}"
                ><a class="ds-grid-paging-prev ui-state-default ui-state-disabled ui-corner-left"><span class="ui-icon ui-icon-triangle-1-w" title="#{msgPrevious}"></span></a></h:panelGroup>
            <c:if test="#{true==ajaxMode}">
                <h:commandLink
                    styleClass="ds-grid-paging-prev ui-state-default ui-corner-left"
                    style="width:16px;height:16px;"                    
                    rendered="#{pageHelper.pageInfo.hasPrevious}">
                    <f:param name="#{pageParamName}" value="#{pageHelper.pageInfo.previousPage}"/>
                    <c:if test="#{! empty parentIdParamName}">
                        <f:param name="#{parentIdParamName}" value="#{parentId}"/>
                    </c:if>
                    <f:ajax execute="@this"  render="@form"/>
                    <span class="ui-icon ui-icon-triangle-1-w" title="#{msgPrevious}">#{msgPrevious}</span>
                </h:commandLink>
            </c:if>
            <c:if test="#{true!=ajaxMode}">
                <h:link
                    styleClass="ds-grid-paging-prev ui-state-default ui-corner-left"
                    style="width:16px;height:16px;"
                    rendered="#{pageHelper.pageInfo.hasPrevious}">
                    <f:param name="#{pageParamName}" value="#{pageHelper.pageInfo.previousPage}"/>
                    <c:if test="#{! empty parentIdParamName}">
                        <f:param name="#{parentIdParamName}" value="#{parentId}"/>
                    </c:if>                    
                    <span class="ui-icon ui-icon-triangle-1-w" title="#{msgPrevious}">#{msgPrevious}</span>
                </h:link>
            </c:if>
            <h:panelGroup
                rendered="#{! pageHelper.pageInfo.hasNext}"
                ><a class="ds-grid-paging-prev ui-state-default ui-state-disabled ui-corner-right"><span class="ui-icon ui-icon-triangle-1-e" title="#{msgNext}"></span></a></h:panelGroup>
            <c:if test="#{true==ajaxMode}">
                <h:commandLink
                    styleClass="ds-grid-paging-next ui-state-default ui-corner-right"
                    style="width:16px;height:16px;"                    
                    rendered="#{pageHelper.pageInfo.hasNext}"  >
                    <f:param name="#{pageParamName}" value="#{pageHelper.pageInfo.nextPage}"/>
                    <c:if test="#{! empty parentIdParamName}">
                        <f:param name="#{parentIdParamName}" value="#{parentId}"/>
                    </c:if>
                    <f:ajax execute="@this"  render="@form"/>

                    <span class="ui-icon ui-icon-triangle-1-e" title="#{msgNext}">#{msgNext}</span>
                </h:commandLink>
            </c:if>
            <c:if test="#{true!=ajaxMode}">
                <h:link
                    styleClass="ds-grid-paging-next ui-state-default ui-corner-right"
                    style="width:16px;height:16px;"
                    rendered="#{pageHelper.pageInfo.hasNext}"  >
                    <f:param name="#{pageParamName}" value="#{pageHelper.pageInfo.nextPage}"/>
                    <c:if test="#{! empty parentIdParamName}">
                        <f:param name="#{parentIdParamName}" value="#{parentId}"/>
                    </c:if>
                    <span class="ui-icon ui-icon-triangle-1-e" title="#{msgNext}">#{msgNext}</span>
                </h:link>
            </c:if>
            <!-- <a href="?results=1" class="ds-grid-paging-prev ui-state-default ui-corner-left"><span class="ui-icon ui-icon-triangle-1-w" title="previous set of results"></span></a>
             <a href="?results=3" class="ds-grid-paging-next ui-state-default ui-corner-right"><span class="ui-icon ui-icon-triangle-1-e" title="next set of results"></span></a> -->
        </div>
        <h:panelGroup  layout="block" style="width:150px;" styleClass="ds-grid-results" rendered="#{-1 lt pageHelper.pageInfo.itemCount}">                            
            <c:if test="#{'page'==infoMode}">
                <h:outputFormat value="#{msgPageOf}">
                    <f:param value="#{pageHelper.pageInfo.currentPage}"/>
                    <f:param value="#{pageHelper.pageInfo.numberOfPages}"/>
                </h:outputFormat>
            </c:if>
            <c:if test="#{'item'==infoMode}">
                <h:outputFormat value="#{msgItemOf}">
                    <f:param value="#{pageHelper.pageInfo.firstItemIndex+1}"/>
                    <f:param value="#{pageHelper.pageInfo.lastItemIndex+1}"/>
                    <f:param value="#{pageHelper.pageInfo.itemCount}"/>
                </h:outputFormat>
            </c:if>       
        </h:panelGroup>
    </div>
</ui:component>